import { Component, OnInit } from '@angular/core';

declare var form: any;

@Component({
  templateUrl: './portal.notice.component.html'
})
export class PortalNoticeComponent implements OnInit {

  fs: any = null;
  // 未读数量
  tip: any = {};

  constructor() {
    this.fs = new form.FormSimpleService('portalnotice', {
      orderObject: { fqsj: 1 },
      keyField: 'id',
      randomFields: ['id']
    });
    // 加载统计数据
    this.fs.statisticsCallback = (sdata) => {
      this.tip = sdata[0];
      if (this.fs.statisname === null || this.fs.statisname === '') {
        this.fs.selectStatistics(sdata[1]);
      }
    };
    this.fs.statistics();
  }

  ngOnInit() {
  }

  editRow(item) {
    if (item) {
      window.open('#protal_noticeinfo_mis?info=true&id=' + item.id);
    } else {
      window.open('#protal_noticeinfo_mis?info=true');
    }
  }
}
